Practical TensorFlow.js by Juan De Dios Santos Rivera

Practical TensorFlow.js by Juan De Dios Santos Rivera

Author:Juan De Dios Santos Rivera
Language: eng
Format: epub
ISBN: 9781484262733
Publisher: Apress


function drawPoint(ctx, y, x, r) {

ctx.beginPath();

ctx.arc(x, y, r, 0, 2 * Math.PI);

ctx.fillStyle = COLOR;

ctx.fill();

}

You might realize that some context methods are those we saw in Chapter 5. The only exception is ctx.arc(), one that draws circles.

After drawPoint(), create drawSegment(), a function that draws the lines between keypoints:function drawSegment([ay, ax], [by, bx], scale, ctx) {

ctx.beginPath();

ctx.moveTo(ax * scale, ay * scale);

ctx.lineTo(bx * scale, by * scale);

ctx.lineWidth = '10px';

ctx.strokeStyle = COLOR;

ctx.stroke();

}



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.